Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove photutils from Astroquery astrometry.net #3067

Merged

Conversation

mfixstsci
Copy link
Contributor

@mfixstsci mfixstsci commented Jul 14, 2024

This PR addresses #2782.

Currently astroquery/astrometry_net/core.py tries to import photutils.detection.DAOStarFinder and astropy.nddata.CCDData and will make decisions on how sources in the fits file passed to AstrometryNetClass are extracted. The following additions will prepare the photutils portion of the algorithm for removal with the goal that if a source catalog is not provided, that nova.astrometry.net will perform the source extraction.

  • Added astropy deprecation warning in code block containing photutils.
  • Added astropy deprecation decorator for and unused parameter and parameter that allows user to bypass or allow nova.astrometry.net to extract sources.

Fixes: #2782.

Copy link

codecov bot commented Jul 14, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 67.55%. Comparing base (f1890ac) to head (1f445f6).
Report is 10 commits behind head on main.

Files Patch % Lines
astroquery/astrometry_net/core.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3067   +/-   ##
=======================================
  Coverage   67.54%   67.55%           
=======================================
  Files         233      233           
  Lines       18320    18327    +7     
=======================================
+ Hits        12375    12380    +5     
- Misses       5945     5947    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -412,6 +415,11 @@ def solve_from_image(self, image_file_path, *, force_image_upload=False,
cache=False,
files={'file': f})
else:
warning_msg = "Removing photutils functionality to obtain extracted positions list from " \
"AstoromertyNetClass.solve_from_source_list. Users will need to " \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"AstoromertyNetClass.solve_from_source_list. Users will need to " \
"AstrometryNetClass.solve_from_source_list. Users will need to " \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @keflavich thank you for the feedback. I fixed the typo in 4e23354

@bsipocz bsipocz added this to the v0.4.8 milestone Jul 14, 2024
@bsipocz
Copy link
Member

bsipocz commented Jul 14, 2024

@mfixstsci - Tip of the day, use these words to cross-link the issue and thus autoclose. Unfortunately 'address' is not part of the list:

https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

@mfixstsci
Copy link
Contributor Author

@mfixstsci - Tip of the day, use these words to cross-link the issue and thus autoclose. Unfortunately 'address' is not part of the list:

https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

Thank you this is really useful!

Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, otherwise it all looks good.

Thanks @mfixstsci

Comment on lines 418 to 421
warning_msg = "Removing photutils functionality to obtain extracted positions list from " \
"AstrometryNetClass.solve_from_source_list. Users will need to " \
"submit pre-extracted catalog positions or a fits file for https://nova.astrometry.net/ " \
"to extract with their algorithm."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but I would rephrase this a bit, as it's the user who sees this message not a third party.

Suggested change
warning_msg = "Removing photutils functionality to obtain extracted positions list from " \
"AstrometryNetClass.solve_from_source_list. Users will need to " \
"submit pre-extracted catalog positions or a fits file for https://nova.astrometry.net/ " \
"to extract with their algorithm."
warning_msg = ("Running photutils functionality within astroquery to obtain extracted positions list from "
"AstrometryNetClass.solve_from_source_list() is deprecated and will be removed in the next release. "
"You need to submit catalog positions or a fits file to obtain an astrometric solution using this service.")

@pep8speaks
Copy link

pep8speaks commented Jul 14, 2024

Hello @mfixstsci! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-07-14 17:22:20 UTC

Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mfixstsci!

@bsipocz bsipocz merged commit 26050ed into astropy:main Jul 14, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

astrometry.net: cleanup API, and remove photutils functionality from astroquery
4 participants